/*
 * @Description: 流程定义数据表*核心表 - 接口
 * @Author: DHL
 * @Date: 2022-08-26 10:30:29
 * @LastEditors: dhlleo dhlleo@126.com
 * @LastEditTime: 2022-12-04 21:50:52
 */

import { $get, $post } from '@/utils/http'
import { ContentTypeEnum } from '@/constant/http'
import {
  ActReProcdefPageParams,
  ActReProcdefPageResultModel,
  ActReProcdefResultModel
} from './model/actReProcdefModel'

/**
 * 分页查询
 */
export const apiActReProcdefSearch = (searchParams: ActReProcdefPageParams) =>
  $get<ActReProcdefPageResultModel>({
    url: '/actReProcdef/search',
    params: searchParams
  })

/**
 * 根据ID获取详情
 */
export const apiActReProcdefGetById = (id: string) =>
  $get<ActReProcdefResultModel>({
    url: '/actReProcdef/getById',
    params: { id: id }
  })

/**
 * 删除
 */
export const apiActReProcdefDeleteById = (id: string, cascade: boolean) =>
  $post<ActReProcdefResultModel>({
    url: '/actReProcdef/deleteById',
    params: { id: id, cascade: cascade }
  })

/**
 * 激活流程定义
 * @param id
 * @returns
 */
export const apiActReProcdefActivate = (id: string) =>
  $post<ActReProcdefResultModel>({
    url: '/actReProcdef/activate',
    contentType: ContentTypeEnum.form,
    params: { id: id }
  })

/**
 * 挂起流程定义
 * @param id
 * @returns
 */
export const apiActReProcdefSuspend = (id: string) =>
  $post<ActReProcdefResultModel>({
    url: '/actReProcdef/suspend',
    contentType: ContentTypeEnum.form,
    params: { id: id }
  })
